import 'package:flutter/material.dart';
import '../services/api_service.dart';

import '../providers/base_provider.dart';

class HealthReminderProvider extends BaseProvider {
  final ApiService _apiService = ApiService();

  String _tipContent = '';

  // Getters
  String get tipContent => _tipContent;
  String get errorMessage => error;

  // 获取健康提示
  Future<void> fetchHealthReminder() async {
    setLoading(true);
    clearError();

    try {
      final reminder = await _apiService.getHealthReminder();
      _tipContent = reminder.content;
      setLoading(false);
    } catch (e) {
      handleApiError(e);
      logger.error('获取健康提示失败', e);
    }
  }
}
